package lab03.test09;

import java.awt.print.Book;
import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class Test {
        int bookNo;
        String bookName;
        String version;
        double price;
        double sales;


        public static class Client {
            private static Object price;

            public static void main(String[] args) {
                //txt文件内容->List
                //单步调试
                //断点    F8  在左边单击，出现一个红点，点bug,再按F8就可以一行一行的看
        /*
        错误：
        1.编译错误：会飘红
        2.运行时错误：运行时下面会出错
         */

                List<Book> books=new ArrayList<Book>();
                String path="D:\\book.txt";
                String path1="D:\\book1.txt";
                BufferedReader reader=null;
                BufferedWriter writer=null;
                try {
                    try {
                        reader=new BufferedReader(new FileReader(path));
                    } catch (FileNotFoundException e) {
                        e.printStackTrace();
                    }

                    String line=null;

                    try {
                        while ((line=reader.readLine())!=null){
                            String[] tokens=line.split("\t");

                            Book book=new Book();

                            books.add(book);

                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }

                    int i=1;

                    writer=new BufferedWriter(new FileWriter(path1));


                    //reader.close();

                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                }finally {
                    try {
                        reader.close();
                        writer.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }
        }

    }

